package app;



import gui.InicioGUI;

import java.net.MalformedURLException;
import java.rmi.Naming;
import java.rmi.RemoteException;
import java.rmi.registry.LocateRegistry;


public class InicioServidor {

	/**
	 * @param args
	 * @throws RemoteException 
	 */
	public static void main(String[] args) throws RemoteException
	{
		/*SessionFactory sf = HibernateUtil.getSessionFactory();
		Session s = sf.openSession(); */
		Controlador controlador = new Controlador();
		ControladorSwing controladorSwing = new ControladorSwing();
		
		
		LocateRegistry.createRegistry(1099);
		try {
			Naming.rebind("TPO_Restaurante", controlador);
			Naming.rebind("//localhost/RmiServer", controladorSwing);
			
			System.out.print("Servidor RMI Inicializado");
		} catch (MalformedURLException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
			System.out.print("Servidor RMI No Inicio por fallas");
		} 
		

		
	}
	
		
}
